

package client;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.xml.ws.WebServiceRef;


@ManagedBean
@RequestScoped
public class WSValidate {
    @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/Caculator/WSCaculatorService.wsdl")
    private WSCaculatorService service;

    private String CardID;
    private String mes;

    public String getMes() {
        return mes;
    }

    public void setMes(String mes) {
        this.mes = mes;
    }

    public String getCardID() {
        return CardID;
    }

    public void setCardID(String CardID) {
        this.CardID = CardID;
    }

    public void validate(){
        Boolean b = validateCard(CardID);
        //b mac dinh se luu gia tri kieu 0,1
        //Khi hien thi ra phai chuuyen sang gia tri String
        mes = b.toString();
    }
    private boolean validateCard(java.lang.String cartId) {
        client.WSCaculator port = service.getWSCaculatorPort();
        return port.validateCard(cartId);
    }

}
